package com.corpgovernment.costcenter.mapper;

import com.corpgovernment.api.organization.dto.request.ProjectInfoDto;
import com.corpgovernment.costcenter.entity.db.MbOrgProjectDepartment;
import com.corpgovernment.costcenter.entity.db.MbOrgProjectInfo;
import com.corpgovernment.organization.common.mybatis.TkMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MbOrgProjectInfoMapper extends TkMapper<MbOrgProjectInfo> {

    List<MbOrgProjectInfo> selectMbOrgProjectInfo(MbOrgProjectInfo mbOrgProjectInfo);

    List<String> selectCostAndProjectOrgId();

    void updateCreateTime(@Param("id") Integer id);

    List<MbOrgProjectDepartment> selectByProjectId(@Param("projectId") Integer projectId);

    List<MbOrgProjectDepartment> selectByProjectIds(@Param("projectIds") List<Long> projectIds);

    List<ProjectInfoDto> getProjectInfoByOrgId(@Param("orgId") String orgId);

    List<ProjectInfoDto> listProjectInfoByOrgId(@Param("orgIdList") List<String> orgIdList);

    List<MbOrgProjectInfo> selectByOrgIds(@Param("orgIdList") List<String> orgIdList);
    int batchInsert(@Param("list") List<MbOrgProjectDepartment> list);

    List<String> selectProjectId(@Param("parentOrgId") String parentOrgId,
                                 @Param("childOrgIdList") List<String> childOrgIdList,
                                 @Param("havingCount") int havingCount);

    List<MbOrgProjectInfo> listProjectInfoByOrgIdNew(@Param("orgIdList") List<String> orgIdList);
}
